package cn.dnui_zjq823.dnuifood_16110100823.controller;

import android.content.SharedPreferences;
import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.v7.app.AppCompatActivity;

import cn.dnui_zjq823.dnuifood_16110100823.R;

/**
 * Created by dell on 2018/10/18.
 */

public abstract class BaseActivity extends AppCompatActivity {
    protected int layout_file= R.layout.activity_main;
    abstract void initViews();
    abstract void initEvents();
    abstract void initDatas();
    protected SharedPreferences sp;
    void setLayout(int layout_file){
        setContentView(layout_file);
    }
    @Override
    protected void onCreate(@Nullable Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setLayout(layout_file);
        sp=getSharedPreferences("login",MODE_PRIVATE);
        initViews();
        initEvents();;
        initDatas();
    }
}
